package org.ch03.job.test09;

/**
 * @author XCH
 * @date 2025 - 03 - 30
 */
public class MainTest {
    public static void main(String[] args) {
        // 创建动物
        Animal lion = new Lion();
        Animal tiger = new Tiger();
        Animal dog = new Dog();
        Animal dolphin = new Dolphin();
        Animal shark = new Shark();
        Animal pigeon = new Pigeon();
        Animal hen = new Hen();

        // 创建饲养员
        Keeper<Mammal> mammalKeeper = new MammalKeeper();
        Keeper<MarineAnimal> marineKeeper = new MarineKeeper();
        Keeper<Bird> birdKeeper = new BirdKeeper();

        // 哺乳动物饲养员工作
        System.out.println("===== 哺乳动物饲养员工作 =====");
        System.out.println("哺乳动物饲养员正在喂养：狮子");
        mammalKeeper.feed((Mammal) lion);
        mammalKeeper.patrol((Mammal) lion);
        mammalKeeper.healthCheck((Mammal) lion);

        System.out.println("-----------------------");

        System.out.println("哺乳动物饲养员正在喂养：老虎");
        mammalKeeper.feed((Mammal) tiger);
        mammalKeeper.patrol((Mammal) tiger);
        mammalKeeper.healthCheck((Mammal) tiger);

        System.out.println("-----------------------");

        System.out.println("哺乳动物饲养员正在喂养：狗");
        mammalKeeper.feed((Mammal) dog);
        mammalKeeper.patrol((Mammal) dog);
        mammalKeeper.healthCheck((Mammal) dog);

        // 海洋动物饲养员工作
        System.out.println("\n===== 海洋动物饲养员工作 =====");
        System.out.println("海洋动物饲养员正在喂养：海豚");
        marineKeeper.feed((MarineAnimal) dolphin);
        marineKeeper.patrol((MarineAnimal) dolphin);
        marineKeeper.healthCheck((MarineAnimal) dolphin);

        System.out.println("-----------------------");

        System.out.println("海洋动物饲养员正在喂养：鲨鱼");
        marineKeeper.feed((MarineAnimal) shark);
        marineKeeper.patrol((MarineAnimal) shark);
        marineKeeper.healthCheck((MarineAnimal) shark);

        // 飞禽动物饲养员工作
        System.out.println("\n===== 飞禽动物饲养员工作 =====");
        System.out.println("飞禽动物饲养员正在喂养：鸽子");
        birdKeeper.feed((Bird) pigeon);
        birdKeeper.patrol((Bird) pigeon);
        birdKeeper.healthCheck((Bird) pigeon);

        System.out.println("-----------------------");

        System.out.println("飞禽动物饲养员正在喂养：母鸡");
        birdKeeper.feed((Bird) hen);
        birdKeeper.patrol((Bird) hen);
        birdKeeper.healthCheck((Bird) hen);
    }
}
